
function selectArea(locationid, form) {
	form.length = 0;
	for (i = 0; i < subcat.length; i++) {
		if (subcat[i][2] == locationid) {
			form.options[form.length] = new Option(subcat[i][1], subcat[i][0]);
		}
	}
}
//-----------------------------------------------------------
function selectSpeciality(locationid, form) {
	form.length = 0;
	for (i = 0; i < subcat1.length; i++) {
		if (subcat1[i][2] == locationid) {
			form.options[form.length] = new Option(subcat1[i][1], subcat1[i][0]);
		}
	}
}
//--------------------------------------------------------------
function insertDate(component) {
	strPage = "js/calendar.htm";
    	//popTop=document.body.scrollTop+event.clientY;
    	//popLeft=document.body.scrollLeft+event.clientX;
	popTop = 220;
	popLeft = 420;
	strAttr = "resizable:no;toolbar:no;status:no;dialogWidth:208px;dialogHeight:208px;help:no;fullscreen:no;dialogTop:" + popTop + ";dialogLeft:" + popLeft + ";";
	html = showModalDialog(strPage, "", strAttr);
	if (html == null) {
		component.value = "";
	} else {
		component.value = html;
	}
}
//--------------------------------------------------------------
function insertDate_manage(component) {
	strPage = "../../js/calendar.htm";
    	//popTop=document.body.scrollTop+event.clientY;
    	//popLeft=document.body.scrollLeft+event.clientX;
	popTop = 220;
	popLeft = 420;
	strAttr = "resizable:no;toolbar:no;status:no;dialogWidth:208px;dialogHeight:208px;help:no;fullscreen:no;dialogTop:" + popTop + ";dialogLeft:" + popLeft + ";";
	html = showModalDialog(strPage, "", strAttr);
	if (html == null) {
		component.value = "";
	} else {
		component.value = html;
	}
}
//--------------------------------------------------------------
function selectyyrq() {
	var strPage;
	strPage = "viewDestine.do";
	html = window.open(strPage, "popupnav", "height=450, width=450, resizable=0,scrollbars=1");
}
//--------------------------------------------------------------
function GetBirthday(psidno) {
	var birthdayno, birthdaytemp;
	if (psidno.length == 18) {
		birthdayno = psidno.substring(6, 14);
	} else {
		if (psidno.length == 15) {
			birthdaytemp = psidno.substring(6, 12);
			birthdayno = "19" + birthdaytemp;
		}
	}
	var birthday = birthdayno.substring(0, 4) + "/" + birthdayno.substring(4, 6) + "/" + birthdayno.substring(6, 8);
	return birthday;
}
//--------------------------------------------------------------
function Getsex(psidno) {
	var sexno, sex;
	if (psidno.length == 18) {
		sexno = psidno.substring(16, 17);
	} else {
		if (psidno.length == 15) {
			sexno = psidno.substring(14, 15);
		}
	}
	var tempid = sexno % 2;
	if (tempid == 0) {
		sex = "0";
	} else {
		sex = "1";
	}
	return sex;
}
//--------------------------------------------------------------
function toSearch(){
	var args=toSearch.arguments;
	theObj=eval("document.all[\'"+args[0]+"\']");
	if(theObj) {
		if(theObj.style.visibility=='visible')
			theObj.style.visibility = 'hidden';
		else
			theObj.style.visibility = 'visible';
	}
}
//-------------------------------------------------------------
function fucCheckNUM(NUM){
	var i,j,strTemp;
	strTemp="0123456789";
	if (NUM.length==0)
		return false;
	for (i=0;i<NUM.length;i++){
		j=strTemp.indexOf(NUM.charAt(i)); 
		if (j==-1){
			return false;
		}
	}
	return true;
}
//------------------------------------------------------------
function selectAll(form){
 for (i = 0;i<form.length;i++){
  if(form.elements[i].type == "checkbox"){
   form.elements[i].checked = true;    
  }
  }
  }
//-----------------------------------------------------------
function cancelAll(form){
 for (i = 0;i<form.length;i++){
  if(form.elements[i].type == "checkbox"){
   form.elements[i].checked = false;    
  }
  }
  }
//-----------------------------------------------------------
function setashomepage(where)
{
	var pagaindex;
	   //pagaindex="http://202.108.59.59/examine/public/";
    if(where =="all")
	{
	   pagaindex="http://210.76.104.3/patent/public/login.jsp";
	}
	/*if(where =="ga")
	{
	   pagaindex="http://202.108.59.58/examine/public/ga";
	}
	if(where =="zj")
	{
	   pagaindex="http://202.108.59.58/examine/zjpublic/";
	}*/
	document.links[0].style.behavior="url(#default#homepage)";
	document.links[0].setHomepage(pagaindex);
	return false;
}
//------------------------------------------------------------
function addtofavorite(where){
	var pageurl = "http://210.76.104.3/patent/public/login.jsp";;
	window.external.addFavorite(pageurl+"",'北京市专利奖励项目申报');
	return false;
}
